<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>${university.universityName}</title>
    <script type="text/javascript" src="/voteup/resources/js/jquery-1.6.1.js"></script>
    <script type="text/javascript" src="/voteup/resources/js/stylescript.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            $(".pane-list li").click(function() {
                window.location = $(this).find("a").attr("href");
                return false;
            });
            $("#btn-slide-group").click(function() {
                $("#groupmatepanel").slideToggle("slow");
                $(this).toggleClass("active");
                return false;
            });
        });
    </script>
</head>
<body>
<c:import url="/WEB-INF/jsp/header.jsp"/>
<c:import url="/WEB-INF/jsp/menu.jsp"/>
<center>
    <c:if test="${not empty university.faculties}">
        <p>

        <h3>Faculties of ${university.universityName}</h3></p>
        <ul class="pane-list">
            <c:forEach items="${university.faculties}" var="faculty">
                <li class="group">
                    <a href="/voteup/faculties/${faculty.facultyId}">${faculty.facultyName}</a>
                </li>
            </c:forEach>
        </ul>
        <c:if test="${not empty universitymates}">
            <p>

            <h3>Top students of ${university.universityName}</h3></p>
            <div id="groupmatepanel">
                <table class="friendlist" cellspacing="4" cellpadding="3">
                    <tr>
                        <c:forEach begin="0" end="4" step="1" items="${universitymates}" var="mate">
                            <td width="75">
                                <table cellpadding="4" cellspacing="0" border="0">
                                    <tr>
                                        <td>
                                            <a href="/voteup//persons/${mate.personId}">
                                                <p align="center"><img
                                                        src="/voteup/resources/img/avatars/${mate.avatar}.jpg" alt=""
                                                        width="30"
                                                        height="40"
                                                        border="0"></p>
                                            </a>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <a href="/voteup//persons/${mate.personId}">
                                                <p align="center">${mate.firstName}<br>
                                                        ${mate.lastName}</p>
                                            </a>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </c:forEach>
                    </tr>
                </table>
            </div>
            <p class="slide"><a href="/voteup/#" class="btn-slide" id="btn-slide-group">Top students</a></p>
        </c:if>
        <c:if test="${empty universitymates}">
            <h3>There are no registered students yet from university ${university.universityName}</h3>
        </c:if>
    </c:if>
    <c:if test="${empty university.faculties}">
        <h3>There are no registered faculties yet in university ${university.universityName}</h3>
    </c:if>
</center>
</body>
</html>